<!--点名管理员信息页-->
<template>
    <div style="height: 100%;">

        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @h-btn-click="hBtnClick"
                @col-btn-click="colBtnClick"
                @search-data="searchData"
        />

        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>
    </div>

</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getRollCallAdminData,editRollCallAdminData,addRollCallAdminData,delRollCallAdminData} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";

  //引用类型字段参数
  import {refOpt} from "../const";

  let opts = {
    // auth_id: 'stop',
    getApi: getRollCallAdminData,
    addApi:addRollCallAdminData,
    editApi:editRollCallAdminData,
    delApi:delRollCallAdminData,
    idKey: 'row_id',
  };
  let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,
    hBtnClick,colBtnClick,searchData,dialogOption,dialogConfirm} = usePageList(opts);

  //  查询条件参数配置
  option.conditions = [
    {...refOpt.user_name,rewriteInput: true,label: '用户编号',field_id:'user_id',col: 8},
    {label: '点名管理人号',type: 'text',field_id: 'rollcall_admin_no',col: 8},
    {label: '点名管理人名',type: 'text',field_id: 'rollcall_admin_name',col: 8},
  ];
  // 表格列显示参数配置
  option.cols = [
    {prop: 'rollcall_admin_no', label: '点名管理人号',},
    {prop: 'rollcall_admin_name', label: '点名管理人名',},
    {prop: 'phone', label: '手机号码',},
    {prop: 'is_used', label: '启用标识',type: 'bool'},
    {prop: 'school_name', label: '所属站点',},
    {prop: 'class_', label: '所属班级',},
    {prop: 'remarks', label: '备注',},
    {prop: 'modify_name', label: '修改员名',},
    {prop: 'modify_time', label: '修改时间',},
    {prop: 'input_name', label: '录入员名',},
    {prop: 'input_time', label: '录入时间',},
  ];


  // 新增编辑弹窗录入项配置
  dialogOption.fieldList = [
    {field_id: 'rollcall_admin_no',label: '点名管理人号',type: 'text',col: 3},
    {field_id: 'rollcall_admin_name', label: '点名管理人名',type: 'text',col: 3},
    {field_id: 'phone', label: '手机号码',type: 'text',col: 3},
    {field_id: 'is_used', label: '启用标识',type: 'bool',col: 3},
    {...refOpt.school_name,label: '所属站点',col: 3,valueKey: ['school_name'],},
    {field_id: 'class_', label: '所属班级',type: 'text',col: 3},
    {field_id: 'remarks', label: '备注',type: 'text',col: 3},
  ];

</script>

